<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bayesian Network: bayesian/matrix.hpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Bayesian Network
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_4922399365a46b010edf8e4eee2a5dfb.html">bayesian</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">matrix.hpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Provide a class representing matrix.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;cstdint&gt;</code><br />
<code>#include &lt;iterator&gt;</code><br />
<code>#include &lt;numeric&gt;</code><br />
<code>#include &lt;algorithm&gt;</code><br />
<code>#include &lt;functional&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for matrix.hpp:</div>
<div class="dyncontent">
<div class="center"><img src="matrix_8hpp__incl.png" border="0" usemap="#bayesian_2matrix_8hpp" alt=""/></div>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="matrix_8hpp__dep__incl.png" border="0" usemap="#bayesian_2matrix_8hppdep" alt=""/></div>
<map name="bayesian_2matrix_8hppdep" id="bayesian_2matrix_8hppdep">
<area shape="rect" id="node2" href="cpt_8hpp.html" title="A wrapper class of bn::matrix provides access methods to the CPT (Conditional Probability Table)..." alt="" coords="37,80,158,107"/>
<area shape="rect" id="node3" href="make__sample_8hpp.html" title="Make a random sample from network and cpts. " alt="" coords="5,155,189,181"/>
<area shape="rect" id="node4" href="rejection__sampling_8hpp.html" title="Infering (Reasoning) any probability $P(Q|E)$ by using Rejection Sampling. " alt="" coords="18,229,177,271"/>
</map>
</div>
</div>
<p><a href="matrix_8hpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbn_1_1matrix.html">bn::matrix&lt; Elem &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provide a class representing dinamic N dimensions (N is equal to or greater than 1).  <a href="classbn_1_1matrix.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a4c268717621b7bf20281acdbb8fe6fc7"><td class="memTemplParams" colspan="2">template&lt;class T , class U &gt; </td></tr>
<tr class="memitem:a4c268717621b7bf20281acdbb8fe6fc7"><td class="memTemplItemLeft" align="right" valign="top">double&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="matrix_8hpp.html#a4c268717621b7bf20281acdbb8fe6fc7">bn::dot</a> (matrix&lt; T &gt; const &amp;lhs, matrix&lt; U &gt; const &amp;rhs)</td></tr>
<tr class="memdesc:a4c268717621b7bf20281acdbb8fe6fc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate matrix inner product (dot) (non-member function).  <a href="matrix_8hpp.html#a4c268717621b7bf20281acdbb8fe6fc7">More...</a><br /></td></tr>
<tr class="separator:a4c268717621b7bf20281acdbb8fe6fc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2733ecb57758071dcf5ab9e6b91a723"><td class="memTemplParams" colspan="2">template&lt;class T , class U &gt; </td></tr>
<tr class="memitem:ae2733ecb57758071dcf5ab9e6b91a723"><td class="memTemplItemLeft" align="right" valign="top">matrix&lt; decltype((*((T *) 0)) *(*((U *) 0)))&gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="matrix_8hpp.html#ae2733ecb57758071dcf5ab9e6b91a723">bn::operator*</a> (matrix&lt; T &gt; const &amp;lhs, matrix&lt; U &gt; const &amp;rhs)</td></tr>
<tr class="memdesc:ae2733ecb57758071dcf5ab9e6b91a723"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate matrix-multiplication.  <a href="matrix_8hpp.html#ae2733ecb57758071dcf5ab9e6b91a723">More...</a><br /></td></tr>
<tr class="separator:ae2733ecb57758071dcf5ab9e6b91a723"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0403b6d145afda53706b4283982fd547"><td class="memTemplParams" colspan="2">template&lt;class T , class U &gt; </td></tr>
<tr class="memitem:a0403b6d145afda53706b4283982fd547"><td class="memTemplItemLeft" align="right" valign="top">matrix&lt; decltype((*((T *) 0)) *(*((U *) 0)))&gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="matrix_8hpp.html#a0403b6d145afda53706b4283982fd547">bn::operator*</a> (matrix&lt; T &gt; const &amp;lhs, U const rhs)</td></tr>
<tr class="memdesc:a0403b6d145afda53706b4283982fd547"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate matrix-multiplication.  <a href="matrix_8hpp.html#a0403b6d145afda53706b4283982fd547">More...</a><br /></td></tr>
<tr class="separator:a0403b6d145afda53706b4283982fd547"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae7042905144ed27f2c811d38e0742f8"><td class="memTemplParams" colspan="2">template&lt;class T , class U &gt; </td></tr>
<tr class="memitem:aae7042905144ed27f2c811d38e0742f8"><td class="memTemplItemLeft" align="right" valign="top">matrix&lt; decltype((*((T *) 0)) *(*((U *) 0)))&gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="matrix_8hpp.html#aae7042905144ed27f2c811d38e0742f8">bn::operator*</a> (T const lhs, matrix&lt; U &gt; const &amp;rhs)</td></tr>
<tr class="memdesc:aae7042905144ed27f2c811d38e0742f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate matrix-multiplication.  <a href="matrix_8hpp.html#aae7042905144ed27f2c811d38e0742f8">More...</a><br /></td></tr>
<tr class="separator:aae7042905144ed27f2c811d38e0742f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Provide a class representing matrix. </p>
<dl class="section author"><dt>Author</dt><dd>godai_0519 </dd></dl>
<dl class="section date"><dt>Date</dt><dd>03/05/2017 </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="file_a4c268717621b7bf20281acdbb8fe6fc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_a4c268717621b7bf20281acdbb8fe6fc7">&#9670;&nbsp;</a></span>dot()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T , class U &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">double bn::dot </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classbn_1_1matrix.html">matrix</a>&lt; T &gt; const &amp;&#160;</td>
          <td class="paramname"><em>lhs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classbn_1_1matrix.html">matrix</a>&lt; U &gt; const &amp;&#160;</td>
          <td class="paramname"><em>rhs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate matrix inner product (dot) (non-member function). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lhs</td><td>This is Left hand of dot. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rhs</td><td>This is Right hand of dot. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>result of doting vector. </dd></dl>

</div>
</div>
<a id="file_ae2733ecb57758071dcf5ab9e6b91a723"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_ae2733ecb57758071dcf5ab9e6b91a723">&#9670;&nbsp;</a></span>operator*() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T , class U &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">matrix&lt;decltype((*((T*)0)) * (*((U*)0)))&gt; bn::operator* </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classbn_1_1matrix.html">matrix</a>&lt; T &gt; const &amp;&#160;</td>
          <td class="paramname"><em>lhs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classbn_1_1matrix.html">matrix</a>&lt; U &gt; const &amp;&#160;</td>
          <td class="paramname"><em>rhs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate matrix-multiplication. </p>
<p>Matrix is multiplied by matrix.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lhs</td><td>This is Left hand matrix of multiplication. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rhs</td><td>This is Right hand matrix of multiplication. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>result of multiplication of matrix. </dd></dl>

</div>
</div>
<a id="file_a0403b6d145afda53706b4283982fd547"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_a0403b6d145afda53706b4283982fd547">&#9670;&nbsp;</a></span>operator*() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T , class U &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">matrix&lt;decltype((*((T*)0)) * (*((U*)0)))&gt; bn::operator* </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classbn_1_1matrix.html">matrix</a>&lt; T &gt; const &amp;&#160;</td>
          <td class="paramname"><em>lhs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">U const&#160;</td>
          <td class="paramname"><em>rhs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate matrix-multiplication. </p>
<p>Matrix is multiplied by scala.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lhs</td><td>This is Left hand matrix of multiplication. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rhs</td><td>This is Right hand scala of multiplication. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>result of multiplication of matrix and scala. </dd></dl>

</div>
</div>
<a id="file_aae7042905144ed27f2c811d38e0742f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_aae7042905144ed27f2c811d38e0742f8">&#9670;&nbsp;</a></span>operator*() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T , class U &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">matrix&lt;decltype((*((T*)0)) * (*((U*)0)))&gt; bn::operator* </td>
          <td>(</td>
          <td class="paramtype">T const&#160;</td>
          <td class="paramname"><em>lhs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classbn_1_1matrix.html">matrix</a>&lt; U &gt; const &amp;&#160;</td>
          <td class="paramname"><em>rhs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate matrix-multiplication. </p>
<p>Scala is multiplied by matrix.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lhs</td><td>This is Left hand scala of multiplication. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rhs</td><td>This is Right hand matrix of multiplication. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>result of multiplication of matrix and scala. </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
